# -*- coding: utf-8 -*-

import wx
from wx.lib.wordwrap import wordwrap

import config


__all__ = ['create']


try:
    licenseText = "".join(open('LICENSE.txt', 'r').readlines())
except:
    licenseText = "None"

def create(parent):
    # First we create and fill the info object
    info = wx.AboutDialogInfo()
    info.Name = parent.GetTitle()
    info.Version = config.__appversion__
    info.Copyright = config.__copyright__
    info.Description = wordwrap(
        _("Only for Study"),
        350, wx.ClientDC(parent))
    info.WebSite = (config.__website__, _("Welcome To My Blog"))
    info.Developers = [ config.__author__ ]
    
    info.License = wordwrap(licenseText, 500, wx.ClientDC(parent))
    
    # Then we call wx.AboutBox giving it that info object
    return wx.AboutBox(info)

